package com.example.ipctest;

import android.content.Intent;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.util.Log;
import android.view.View;

public class MainActivity extends AppCompatActivity {
    private static final String TAG = "MainActivity";

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        findViewById(R.id.btn_by_colon).setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Intent intent = new Intent(MainActivity.this, SecondActivity.class);
                startActivity(intent);
            }
        });
        findViewById(R.id.btn_notby_colon).setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Intent intent = new Intent(MainActivity.this, ThirdActivity.class);
                startActivity(intent);
            }
        });
        testMultiProcessDataSafe();
    }

    /**
     * 测试多进程数据共享问题
     */
    private void testMultiProcessDataSafe() {
        Log.e(TAG, "修改之前的testMultiProcess:" + TestBean.testMultiProcess);
        TestBean.testMultiProcess = 100;
        Log.e(TAG, "修改之后的testMultiProcess:" + TestBean.testMultiProcess);
    }
}
